/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ManagedBeans;

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 *
 * @author ANTHONY
 */
@ManagedBean
@SessionScoped
public class ManagedBeanSession implements Serializable{
    public void isSessionValid() {

    try {
        
       final FacesContext context = FacesContext.getCurrentInstance();
     
      final HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
      final HttpSession session = (HttpSession) context.getExternalContext().getSession(false);
      session.invalidate();
     } catch (Exception e) {
            
     }
}
    
     
}
